home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-10-10 | 1.9 KB | 64 lines | [TEXT/CWIE] |
- /*
- ** MacWT -- a 3d game engine for the Macintosh
- ** © 1995, Bill Hayden and Nikol Software
- ** Free for non-commercial use - address questions to the e-mail address below
- **
- ** Mail: afn28988@freenet.ufl.edu (Bill Hayden)
- ** MacWT FTP site: ftp.circa.ufl.edu/pub/software/ufmug/mirrors/LocalSW/Hayden/
- ** WWW Page: http://grove.ufl.edu:80/~nikolsw
- **
- ** All of the above addresses are due to changes sometime in 1996, so stay tuned
- **
- ** based on wt, by Chris Laurel
- **
- ** This program is distributed in the hope that it will be useful,
- ** but WITHOUT ANY WARRANTY; without even the implied warranty of
- ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-
-
- // (8 sides x 4 frames)
- #define MAX_IMAGES 32
-
-
- typedef struct {
- double mass;
- double xsize, ysize, height;
- double x, y, z;
- double dx, dy, dz;
- double angle;
- double angular_v;
- double drag;
- short num_images;
- short cur_image;
- long frameticks; // Ticks until frame is advanced (zero means as fast as possible)
- long triggerticks; // Next frame advance time in 1/60 seconds (ticks)
- long reference; // To keep track of who's who or other pertinant data
- World *world;
- Region *region;
- Texture *image[MAX_IMAGES];
- } Object;
-
- typedef struct {
- double left;
- double top;
- double right;
- double bottom;
- } Bounds;
-
- extern Object *new_object(double mass, double xsize, double ysize, double height, double drag);
- extern void object_update(Object *o);
- extern void object_apply_force(Object *o, double fx, double fy, double fz);
- extern void object_apply_torque(Object *o, double torque);
- extern void object_set_position(Object *o, double x, double y, double z);
-
- extern void add_object(World *w, Object *o);
- extern Boolean remove_object(World *w, Object *o);
-
- extern void object_view(Object *o, View *v);
-
- void AdvanceFrame(Object *o);
- Boolean AddFrame(Object *o, char *TextureName);
- #define SetFrame(o,num) (o)->cur_image=num
-